/* 导入共享样式 */
@import url('../common/reset.css');
@import url('../common/variables.css');
@import url('../components/buttons.css');
@import url('../components/forms.css');
@import url('../components/alerts.css');

/* 全局样式变量 */
:root {
    --primary-color: #4c6ef5;
    --primary-light: #e7eaff;
    --secondary-color: #5e60ce;
    --success-color: #40c057;
    --warning-color: #fcc419;
    --danger-color: #fa5252;
    --info-color: #15aabf;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --body-bg: #f5f7fb;
    --sidebar-bg: #ffffff;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --border-radius: 0.375rem;
    --transition-speed: 0.3s;
    
    /* 聊天界面特定颜色 */
    --ai-message-bg: #e7eaff;
    --user-message-bg: #f5f7fb;
    --chat-input-bg: #ffffff;
    --timeline-color: #4c6ef5;
    --female-color: #e83e8c;
}

/* 页面整体布局 */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--body-bg);
}

/* 主内容区布局 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* 诊断页面内容 */
.content {
    padding: 2rem;
}

/* 诊断容器布局 */
.diagnosis-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    height: calc(100vh - var(--header-height) - 4rem);
}

/* 全宽容器（无左侧面板） */
.diagnosis-container.full-width {
    grid-template-columns: 1fr;
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - var(--header-height) - 5rem);
    display: flex;
    flex-direction: column;
}

/* 面板通用样式 */
.patient-info-panel,
.ai-diagnosis-panel {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.panel-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* 患者信息卡片 */
.patient-card {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.patient-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.patient-avatar.female {
    background-color: #ffeef4;
    color: var(--female-color);
}

.patient-details h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.patient-details p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--dark-color);
    display: flex;
}

.patient-details p span:first-child {
    font-weight: 500;
    width: 70px;
    color: #6c757d;
}

/* 患者病史时间线 */
.patient-history h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.history-timeline {
    position: relative;
    padding-left: 20px;
}

.history-timeline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background-color: var(--primary-light);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.timeline-date {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.timeline-content p {
    font-size: 0.9rem;
    color: #6c757d;
}

/* AI诊断聊天区域 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - var(--header-height) - 6rem);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    max-height: calc(100vh - var(--header-height) - 12rem);
}

.message {
    display: flex;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.ai-message {
    align-items: flex-start;
}

.user-message {
    flex-direction: row-reverse;
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
}

/* AI头像样式 */
.ai-message .message-avatar {
    background-color: var(--primary-light);
    color: var(--primary-color);
    overflow: hidden;
}

.ai-message .message-avatar.ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 用户头像样式 */
.user-message .message-avatar {
    background-color: #f8f9fa;
    color: var(--dark-color);
    overflow: hidden;
}

.user-message .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
}

.message-text {
    padding: 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ai-message .message-text {
    background-color: var(--ai-message-bg);
    border-top-left-radius: 0;
}

.user-message .message-text {
    background-color: var(--user-message-bg);
    border-top-right-radius: 0;
    text-align: right;
}

.message-text p {
    margin-bottom: 0.75rem;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.message-text ul li {
    margin-bottom: 0.25rem;
    list-style-type: disc;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.ai-message .message-time {
    text-align: left;
}

.user-message .message-time {
    text-align: right;
}

/* 聊天输入区域 */
.chat-input {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem;
    background-color: var(--chat-input-bg);
}

.input-tools {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tool-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background-color: var(--light-color);
    border-radius: 1rem;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
}

.input-container textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    max-height: 120px;
    min-height: 40px;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn:hover {
    background-color: var(--primary-hover, #3a56d4);
}

/* AI思考动画 */
.message-text.thinking {
    display: flex;
    align-items: center;
}

.message-text.thinking .dot-1,
.message-text.thinking .dot-2,
.message-text.thinking .dot-3 {
    animation: typing 1.5s infinite;
    font-size: 1.5rem;
    line-height: 0.5;
}

.message-text.thinking .dot-1 {
    animation-delay: 0s;
}

.message-text.thinking .dot-2 {
    animation-delay: 0.5s;
}

.message-text.thinking .dot-3 {
    animation-delay: 1s;
}

@keyframes typing {
    0%, 100% {
        opacity: 0.2;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* 错误消息 */
.message-text.error {
    background-color: #ffeeee;
    border-left: 3px solid var(--danger-color);
    color: #d63031;
}

/* 患者选择弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 500px;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: var(--light-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-300, #dee2e6);
    border-radius: 0.375rem;
    outline: none;
    font-size: 0.95rem;
}

.search-container button {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.patient-list {
    max-height: 300px;
    overflow-y: auto;
}

.patient-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.patient-item:hover {
    background-color: var(--light-color);
}

.patient-item.selected {
    background-color: var(--primary-light);
}

.patient-item .patient-avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.patient-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.patient-info p {
    font-size: 0.85rem;
    color: #6c757d;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* 帮助指南模态框样式 */
.help-section {
    margin-bottom: 1.5rem;
}

.help-section h3 {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.help-section h3 span {
    margin-right: 8px;
}

.help-section ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.help-section ul li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.help-section p {
    line-height: 1.5;
    color: #555;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .diagnosis-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .diagnosis-container.full-width {
        width: 95%;
    }
    
    .ai-diagnosis-panel {
        height: calc(100vh - var(--header-height) - 4rem);
    }
}

@media (max-width: 576px) {
    .content {
        padding: 1rem;
    }
    
    .diagnosis-container {
        gap: 1rem;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
} 